package com.dinpay.plugin.activity;

import android.content.Context;
import android.content.Intent;
import android.graphics.Color;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.os.Bundle;
import android.os.Handler;
import android.view.KeyEvent;
import android.view.WindowManager.LayoutParams;
import android.widget.LinearLayout;
import android.widget.LinearLayout.LayoutParams;
import android.widget.ProgressBar;
import android.widget.RelativeLayout;
import android.widget.RelativeLayout.LayoutParams;
import android.widget.TextView;
import com.dinpay.plugin.b.d;
import com.dinpay.plugin.c.a.a;
import com.dinpay.plugin.c.a.b;
import com.dinpay.plugin.d.e;
import com.dinpay.plugin.d.f;
import com.dinpay.plugin.d.i;
import com.dinpay.plugin.widget.b;
import java.io.ByteArrayInputStream;
import java.util.Map;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

public class DinpayChannelActivity extends DinpayBaseActivity
{
  public static String a;
  public d b;
  private String c;
  private com.dinpay.plugin.b.c d;
  private b e;
  private Context f;
  private Handler g = new j(this);

  protected void onActivityResult(int paramInt1, int paramInt2, Intent paramIntent)
  {
    super.onActivityResult(paramInt1, paramInt2, paramIntent);
    if (paramIntent == null);
    String str;
    do
    {
      do
        return;
      while (paramIntent == null);
      str = paramIntent.getExtras().getString("pay_result");
      if (str.equalsIgnoreCase("success"))
      {
        a("SUCCESS", a);
        return;
      }
      if (str.equalsIgnoreCase("fail"))
      {
        a("FAILED", a);
        return;
      }
    }
    while (!str.equalsIgnoreCase("cancel"));
    a("UNPAY", a);
  }

  protected void onCreate(Bundle paramBundle)
  {
    super.onCreate(paramBundle);
    RelativeLayout localRelativeLayout = new RelativeLayout(this);
    localRelativeLayout.setLayoutParams(new WindowManager.LayoutParams(-1, -1));
    getResources();
    localRelativeLayout.setBackgroundDrawable(i.a(DinpayBaseActivity.class, a.a.b));
    RelativeLayout.LayoutParams localLayoutParams = new RelativeLayout.LayoutParams(-2, -2);
    LinearLayout localLinearLayout = new LinearLayout(this);
    localLayoutParams.addRule(13);
    localLinearLayout.setLayoutParams(localLayoutParams);
    localLinearLayout.setOrientation(1);
    localRelativeLayout.addView(localLinearLayout);
    LinearLayout.LayoutParams localLayoutParams1 = new LinearLayout.LayoutParams(-2, -2);
    ProgressBar localProgressBar = new ProgressBar(this);
    localLayoutParams1.gravity = 17;
    localProgressBar.setLayoutParams(localLayoutParams1);
    localLinearLayout.addView(localProgressBar);
    LinearLayout.LayoutParams localLayoutParams2 = new LinearLayout.LayoutParams(-2, -2);
    TextView localTextView = new TextView(this);
    localLayoutParams2.gravity = 17;
    localLayoutParams2.topMargin = 8;
    localTextView.setGravity(17);
    localTextView.setLayoutParams(localLayoutParams2);
    localTextView.setTextColor(Color.parseColor("#999999"));
    localTextView.setTextSize(22.0F);
    localTextView.setText(a.b.d);
    localLinearLayout.addView(localTextView);
    setContentView(localRelativeLayout);
    this.f = this;
    ExitApplication.a().a(this);
    Intent localIntent = getIntent();
    if (localIntent != null)
    {
      this.c = localIntent.getStringExtra("xml");
      a = localIntent.getStringExtra("ActivityName");
    }
    if (this.c == null)
    {
      c("商家请求报文不能为空");
      return;
    }
    ByteArrayInputStream localByteArrayInputStream = new ByteArrayInputStream(this.c.getBytes());
    try
    {
      this.b = f.b(localByteArrayInputStream);
      if (!e.a(this.b))
      {
        c((String)com.dinpay.plugin.d.c.a.get(e.a));
        return;
      }
    }
    catch (Exception localException)
    {
      localException.printStackTrace();
      c("商家请求报文格式有误");
      return;
    }
    NetworkInfo localNetworkInfo = ((ConnectivityManager)getSystemService("connectivity")).getActiveNetworkInfo();
    if ((localNetworkInfo != null) && (localNetworkInfo.isConnected()));
    for (int i = 1; i == 0; i = 0)
    {
      c("无法连接网络,请检查网络配置");
      return;
    }
    Executors.newSingleThreadExecutor().execute(new k(this));
  }

  protected void onDestroy()
  {
    super.onDestroy();
    if (this.e != null)
    {
      this.e.cancel();
      this.e = null;
    }
  }

  public boolean onKeyDown(int paramInt, KeyEvent paramKeyEvent)
  {
    return super.onKeyDown(paramInt, paramKeyEvent);
  }

  protected void onResume()
  {
    super.onResume();
  }
}

/* Location:           C:\Users\user\Desktop\dd28_pcdd720\classes_dex2jar.jar
 * Qualified Name:     com.dinpay.plugin.activity.DinpayChannelActivity
 * JD-Core Version:    0.6.2
 */